package com.koala.learn.excellearn;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.koala.learn.excellearn.entity.Student;
import com.koala.learn.excellearn.entity.Worker;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author yantingrui
 * @date 2022/5/7   16:31
 */
public class zhuanxing {

    public static void main(String[] args) {
        Student student = new Worker("tom", 1, null, "work1");
        new Worker("1", 1, LocalDateTime.now(), "1");

        // {"age":1,"name":"tom","workId":"work1"}
        System.out.println(JSON.toJSONString(student));
    }


    //static List<Student> fun(){
    //    List<Worker> workers = Lists.newArrayList(new Worker("1", 1, LocalDateTime.now(), "1"));
    //
    //}

    static <T> List<T> fun1() {
        List<Worker> workers = Lists.newArrayList(new Worker("1", 1, LocalDateTime.now(), "1"));
        return (List<T>) workers;
    }

    //List<Worker> fun2(){
    //    List<Student> workers = Lists.newArrayList(new Student("1", 1, LocalDateTime.now()));
    //    return workers;
    //}

}
